<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_contact
 *
 * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidation');
JHtml::_('behavior.tooltip');
$cparams = JComponentHelper::getParams('com_media');

jimport('joomla.html.html.bootstrap');
$Itemid = JRequest::getVar('Itemid', '');

?>
<style type='text/css'>
	.contact{
		width:500px;
		margin:0 auto;
		border: 1px solid;
		margin-top:2px;
	}
	.col-f2,.col-f2 h3{color:#000;}
	#ContactDesign{clear:both;}
	.col-f2 h3{height:75px;}
	#contact-form textarea{
		background: url("<?php echo JURI::base();?>templates/wonder/images/w.png") repeat scroll 0 0 transparent !important;
		border: 1px solid #fff;
		color: #000 !important;
		height: 165px;
		line-height: 20px;
		overflow: auto;
		width: 99%;
	}
	#jform_contact_name {  width: 176px;}
	#jform_contact_email { 
	width: 210px;}
	#jform_contact_emailmsg{
		float:left;
		width:400px;
	}
	
#jform_contact_email{width:196px;}
#jform_Birth{width:47px}
#jform_Address{width:189px;}
#jform_Province_Code{width:144px;}
#contact-form input{
	border-top: 1px solid #fff;
	border-left: 1px solid #fff;
	border-right: 1px solid #fff;
	border-bottom: 1px solid #666;
}
#jform_Phone{width:130px;}
select#jform_Province_Code{border: none;}
#contact-form input.invalid,#contact-form textarea.invalid {
    border:1px solid red;
}
#system-message{width:500px;margin:0 auto;}
body.horizontal #header {
    height: 92px !important;
}
.col-f2{padding-left:25px;
padding-top:20px;}
.invalid {
    border-color: red !important;
}
</style>
<div class="contact<?php echo $this->pageclass_sfx?>">
<form id="" action="<?php echo JURI::base(); ?>index.php?option=com_contact&view=contact&id=<?php $this->contact->id;?>&Itemid=<?php echo $Itemid;?>" method="post" class="form-validate form-horizontal">
<?php if (isset($this->error)) : ?>
	<div class="contact-error">
		<?php echo $this->error; ?>
	</div>
<?php endif; ?>
<?php if ($this->params->get('show_contact_list') && count($this->contacts) > 1) : ?>
	<?php endif; ?>
		<div class="col-f2 last" style="position:relative;">
			<a id="lienhe"></a>
			<h3><a href="#" tppabs="#" style="color:#000; font-weight:bold;"><?php echo $this->escape($this->params->get('page_heading')); ?></a><span class="hotline">Hotline: <?php echo $this->contact->telephone;?></span></h3>
			<div style="position:absolute;top:65px;color:#ED1C24;font-size: 12px;font-weight:bold;">Điền vào form bên dưới hoặc gửi trực tiếp vào mail:</div>
			<div style="position:absolute;top:65px;right:0;color:#000;font-weight:bold;font-size: 12px;"><?php echo $this->contact->email_to;?></div>
				<div id="contact-form">
                    <div id="ContactOutput"></div>
					<label for="Fullname">Họ và tên:</label> 
					<?php echo $this->form->getInput('contact_name'); ?>
					<!--<input type="text" name="Fullname" id="Fullname" value=""/>-->
					<label for="Birth">Năm sinh:</label> 					
					<input type="text" id="jform_Birth" type="namsinh" class="required validate-namsinh" name="jform[Birth]" value=""/>
					<input type="radio" name="jform[Gender]" checked id="nam" value="nam"/> <label for="nam">Nam</label>
					<input type="radio" name="jform[Gender]" id="nu" value="nu"/> <label for="nu">Nữ</label><br />
					<div class="clear"></div>
						
					<label for="Email">Email:</label> 
					<?php echo $this->form->getInput('contact_email'); ?>
					<!--<input type="text" name="Email" id="Email" value=""/>-->
					<label for="Phone">Số điện thoại:</label> <input class="required validate-phone" type="text" name="jform[Phone]" id="jform_Phone" value=""/>
					<div class="clear"></div>
						
					<label for="Address">Địa chỉ:</label> <input type="text" name="jform[Address]" id="jform_Address" value=""/>
					<label for="Province_Code">Tỉnh, thành:</label>
                    <select class="locationSelectBox" id="jform_Province_Code" name="jform[Province_Code]"><option value=""></option>
<option value="AGI">An Giang</option>
<option value="BRV">B&#224; Rịa-Vũng T&#224;u</option>
<option value="BGI">Bắc Giang</option>
<option value="BKA">Bắc Kạn</option>
<option value="BLI">Bạc Li&#234;u</option>
<option value="BNI">Bắc Ninh</option>
<option value="BTR">Bến Tre</option>
<option value="BDI">B&#236;nh Định</option>
<option value="BDU">B&#236;nh Dương</option>
<option value="BPH">B&#236;nh Phước</option>
<option value="BTH">B&#236;nh Thuận</option>
<option value="CMA">C&#224; Mau</option>
<option value="CTH">Cần Thơ</option>
<option value="CBA">Cao Bằng</option>
<option value="DNG">Đ&#224; Nẵng</option>
<option value="DLA">Đắk Lắk</option>
<option value="DNO">Đắk N&#244;ng</option>
<option value="DBI">Điện Bi&#234;n</option>
<option value="DNI">Đồng Nai</option>
<option value="DTH">Đồng Th&#225;p</option>
<option value="GLA">Gia Lai</option>
<option value="HGG">H&#224; Giang</option>
<option value="HNA">H&#224; Nam</option>
<option value="HNO">H&#224; Nội (incl. H&#224; T&#226;y)</option>
<option value="HTI">H&#224; Tĩnh</option>
<option value="HDU">Hải Dương</option>
<option value="HPH">Hải Ph&#242;ng</option>
<option value="HAU">Hậu Giang</option>
<option value="HCM">Hồ Ch&#237; Minh</option>
<option value="HBI">H&#242;a B&#236;nh</option>
<option value="HYE">Hưng Y&#234;n</option>
<option value="KHO">Kh&#225;nh H&#242;a</option>
<option value="KGI">Ki&#234;n Giang</option>
<option value="KTU">Kon Tum</option>
<option value="LCH">Lai Ch&#226;u</option>
<option value="LDO">L&#226;m Đồng</option>
<option value="LSO">Lạng Sơn</option>
<option value="LCA">L&#224;o Cai</option>
<option value="LAN">Long An</option>
<option value="NDI">Nam Định</option>
<option value="NAN">Nghệ An</option>
<option value="NBI">Ninh B&#236;nh</option>
<option value="NTH">Ninh Thuận</option>
<option value="PTH">Ph&#250; Thọ</option>
<option value="PYE">Ph&#250; Y&#234;n</option>
<option value="QBI">Quảng B&#236;nh</option>
<option value="QNA">Quảng Nam</option>
<option value="QNG">Quảng Ng&#227;i</option>
<option value="QNI">Quảng Ninh</option>
<option value="QTR">Quảng Trị</option>
<option value="STR">S&#243;c Trăng</option>
<option value="SLA">Sơn La</option>
<option value="TNI">T&#226;y Ninh</option>
<option value="TBI">Th&#225;i B&#236;nh</option>
<option value="TNG">Th&#225;i Nguy&#234;n</option>
<option value="THO">Thanh H&#243;a</option>
<option value="TTH">Thừa Thi&#234;n-Huế</option>
<option value="TGI">Tiền Giang</option>
<option value="TVI">Tr&#224; Vinh</option>
<option value="TQU">Tuy&#234;n Quang</option>
<option value="VLO">Vĩnh Long</option>
<option value="VPH">Vĩnh Ph&#250;c</option>
<option value="YBA">Y&#234;n B&#225;i</option>
</select>
					<div class="clear"></div>
											
					<label for="Subject">Subject:</label> 
					<?php echo $this->form->getInput('contact_subject'); ?>	
					<div class="clear" style="height:10px;"></div>
					<label for="Note"><strong>Nội dung:</strong></label><br />
					<?php echo $this->form->getInput('contact_message'); ?>
					
					<?php if ($this->params->get('show_email_copy')) { ?>
				<div class="control-group">
					<div class="control-label"><?php echo $this->form->getLabel('contact_email_copy'); ?></div>
					<div class="controls"><?php echo $this->form->getInput('contact_email_copy'); ?></div>
				</div>
			<?php } ?>
					<?php //Dynamically load any additional fields from plugins. ?>
			<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
				<?php if ($fieldset->name != 'contact'):?>
					<?php $fields = $this->form->getFieldset($fieldset->name);?>
					<?php foreach ($fields as $field) : ?>
						<div class="control-group">
							<?php if ($field->hidden) : ?>
								<div class="controls">
									<?php echo $field->input;?>
								</div>
							<?php else:?>
								<div class="control-label">
									<?php echo $field->label; ?>
									<?php if (!$field->required && $field->type != "Spacer") : ?>
										<span class="optional"><?php echo JText::_('COM_CONTACT_OPTIONAL');?></span>
									<?php endif; ?>
								</div>
								<div class="controls"><?php echo $field->input;?></div>
							<?php endif;?>
						</div>
					<?php endforeach;?>
				<?php endif ?>
			<?php endforeach;?>
			<div class="form-actions"><button class="btn btn-primary validate" type="submit"><?php echo JText::_('COM_CONTACT_CONTACT_SEND'); ?></button>
				<input type="hidden" name="option" value="com_contact" />
				<input type="hidden" name="Itemid" value="<?php echo $Itemid;?>" />
				<input type="hidden" name="task" value="contact.submit" />
				<input type="hidden" name="return" value="<?php echo $this->return_page;?>" />
				<input type="hidden" name="id" value="<?php echo $this->contact->slug; ?>" />
				<input type="hidden" name="idid" value="<?php echo $this->contact->id; ?>" />
				<?php echo JHtml::_('form.token'); ?>
			</div>
				</div>
			<div class="clear" style="height:125px;"></div>
		</div><!-- .col4-f2 -->
	</form>
		<div class="clear"></div>
</div>
